package router

import (
	"gddgame.cc/galaxy/binocle"
	. "gddgame.cc/galaxy/common/dsl/db"
	. "gddgame.cc/galaxy/common/dsl/web"
	"gddgame.cc/galaxy/core/routers"
	"gddgame.cc/galaxy/project/maze/maze/controller"
	"gddgame.cc/galaxy/server/composer"
	"gddgame.cc/galaxy/server/web"
)

func SystemHandler(path string, builder composer.Builder, router web.Router) {
	var agent binocle.App
	builder.Factory("agent", &agent)

	r := NewSwaggerRouter(path, builder, router, &SwaggerRouterConfig{
		Info: SwaggerInfo{
			Title: "",
		},
	})

	web.Restful(router)
	routers.ManageRouterBind(builder, r)
	controller.Env.BindRouter(r)

	_ = TableRouterWith(builder, r.Group("/db"), agent.Name())
}
